<%@ page pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.ld.com/shield/tags" prefix="shield"%>
<c:set var="now" value="<%= new java.util.Date() %>"/>
<%@ page trimDirectiveWhitespaces="true" %>
<fmt:setLocale value="zh_CN"/>
<shield:permssion type="button">
<div >
	<!-- t改为shieldTarget，且为jQuery选择器形式 -->
    <form action="${ctxPathA}/oa/work/todayTask/search" method="post" shieldTarget="#searchResult" class="searchForm">
        <div class="search-box">
		    <span class="search-i"><b>标题：</b><input type="text" name="<shield:encrypt value="like_title"/>"/></span>
		 	<c:if test="${not empty sessionScope.sign}">
		    <span class="search-i"><b>创建人：</b>
			    <select class="select2_plugin" name="<shield:encrypt value="equal_createBy"/>">
					<option value="">全部</option>
					<c:forEach var="user" items="${userList}">
					<option value="${user.id }">${user.userName}</option>
					</c:forEach>
			   </select></span>
			</c:if> 
		    <span class="search-i"><b>日期：</b>
		    	<input type="text" name="<shield:encrypt value="date_sstartDate"/>" class="Wdate" value='<fmt:formatDate value="${now }" pattern="yyyy-MM-dd"/>'
                   id="startDate" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')}'})"/>-
            	<input type="text"name="<shield:encrypt value="date_estartDate"/>" value="" class="Wdate" id="endDate" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startDate\')}'})"/>
            </span>
            <span class="search-i">
	            <input class="submit" type="submit" name="doSearch" value="查询">
	            <!-- href改为data-url -->
	            <c:if test="${empty sessionScope.sign }">
	            <a data-url="${ctxPathA }/oa/work/todayTask/toAddOrUpdate" class="shieldDialog" viewTitle="添加今日任务信息" viewWidth="1000">
	            	<input class="addBaseTable" type="button" name="addBaseTable" value="添加">
	            </a>
	             <a data-url="${ctxPathA }/oa/work/weeklyReport/oaweeklyReport" paramSelector ="#startDate,#endDate" class="shieldDialog" viewTitle="生成周报" viewWidth="1000">
	            	<input class="addBaseTable" type="button" name="addBaseTable" value="生成周报">
	            </a>
	            </c:if>
            </span>
        </div>
        <div id="searchResult"></div>
    </form>
</div>
</shield:permssion>